<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 食堂外卖验证器
 */
class Sell extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        
        'dpid'              => 'require|number',
        'orderid'               => 'require|number',
        'foodid'              => 'require|number',
        'number'              => 'require|number',
        'total'               => 'require|number',
        'usseat'              => 'require|unique:sell',
    ];

    // 验证提示
    protected $message  =   [
        
        'dpid.require'              => '店铺编号不能为空',
        'dpid.number'               => '店铺编号必须为数字',
        'orderid.require'              => '订单编号不能为空',
        'orderid.number'               => '订单编号必须为数字',
        'foodid.require'              => '菜品编号不能为空',
        'foodid.number'               => '菜品编号必须为数字',
        'number.require'              => '数量不能为空',
        'number.number'               => '数量必须为数字',
        'total.require'              => '总价能为空',
        'total.number'               => '总价必须为数字',
        'usseat.require'               => '地址不能为空',
        
       
    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['dpid','orderid','foodid','number','total','usseat'],
    ];
    
}
